import { call } from 'naive-ui/es/_utils'
import { get, post, del } from '@/axios'
const moduleUrl = '/question'
const url = {
	page: moduleUrl + '/page',
	upload: moduleUrl + '/upload',
	import: moduleUrl + '/import'
}
const getTableData = (params) => {
	return new Promise(resolve => {
		get(url.page, params, content => {
			resolve(content)
		})
	}) 
}
const uploadFile = (file, callback) => {
	post(url.upload, { file }, content => {
		callback(content)
	})
}
const importFile = ({ content }, callback) => {
	post(url.import, { content }, result => {
		callback(result)
	})
}
export default {
	getTableData,
	uploadFile,
	importFile
}